##########################################################
## Setar o diretorio de trabalho
##########################################################

setwd("/Users/felype/Documents/CIn/Mestrado/Estatistica/workspaceEstatistica/estatistica/ScriptR/base")
#setwd("/home/felipe/workspace-msc/estatistica/Generator/base")

##########################################################
##  Leitura dos Dados
##########################################################

#passo2, passo3, passo4, passo5
voluntario01git <- read.table("voluntario01git.txt",sep=",")
voluntario02git <- read.table("voluntario02git.txt",sep=",")
voluntario03git <- read.table("voluntario03git.txt",sep=",")
voluntario04git <- read.table("voluntario04git.txt",sep=",")
voluntario05git <- read.table("voluntario05git.txt",sep=",")

voluntario01svn <- read.table("voluntario01svn.txt",sep=",")
voluntario02svn <- read.table("voluntario02svn.txt",sep=",")
voluntario03svn <- read.table("voluntario03svn.txt",sep=",")
voluntario04svn <- read.table("voluntario04svn.txt",sep=",")
voluntario05svn <- read.table("voluntario05svn.txt",sep=",")


##########################################################
## Cada conjunto � um tipo de classe dessa flor
##########################################################

#passo2, passo5, passo3+passo4
#TCB, TIB, TIL
voluntario01git <- cbind(voluntario01git[1,2], voluntario01git[2:6,2],voluntario01git[2:6,5],voluntario01git[2:6,3]+voluntario01git[2:6,4])
voluntario02git <- cbind(voluntario02git[1,2], voluntario02git[2:6,2],voluntario02git[2:6,5],voluntario02git[2:6,3]+voluntario02git[2:6,4])
voluntario03git <- cbind(voluntario03git[1,2], voluntario03git[2:6,2],voluntario03git[2:6,5],voluntario03git[2:6,3]+voluntario03git[2:6,4])
voluntario04git <- cbind(voluntario04git[1,2], voluntario04git[2:6,2],voluntario04git[2:6,5],voluntario04git[2:6,3]+voluntario04git[2:6,4])
voluntario05git <- cbind(voluntario05git[1,2], voluntario05git[2:6,2],voluntario05git[2:6,5],voluntario05git[2:6,3]+voluntario05git[2:6,4])
voluntario01git
voluntario01svn <- cbind(voluntario01svn[1,2], voluntario01svn[2:6,2],voluntario01svn[2:6,5],voluntario01svn[2:6,3]+voluntario01svn[2:6,4])
voluntario02svn <- cbind(voluntario02svn[1,2], voluntario02svn[2:6,2],voluntario02svn[2:6,5],voluntario02svn[2:6,3]+voluntario02svn[2:6,4])
voluntario03svn <- cbind(voluntario03svn[1,2], voluntario03svn[2:6,2],voluntario03svn[2:6,5],voluntario03svn[2:6,3]+voluntario03svn[2:6,4])
voluntario04svn <- cbind(voluntario04svn[1,2], voluntario04svn[2:6,2],voluntario04svn[2:6,5],voluntario04svn[2:6,3]+voluntario04svn[2:6,4])
voluntario05svn <- cbind(voluntario05svn[1,2], voluntario05svn[2:6,2],voluntario05svn[2:6,5],voluntario05svn[2:6,3]+voluntario05svn[2:6,4])


conjuntoMediasTCBgit = c(mean(voluntario01git[,2]),mean(voluntario02git[,2]),mean(voluntario03git[,2]),mean(voluntario04git[,2]),mean(voluntario05git[,2]))
conjuntoMediasTIBgit = c(mean(voluntario01git[,3]),mean(voluntario02git[,3]),mean(voluntario03git[,3]),mean(voluntario04git[,3]),mean(voluntario05git[,3]))
conjuntoMediasTILgit = c(mean(voluntario01git[,4]),mean(voluntario02git[,4]),mean(voluntario03git[,4]),mean(voluntario04git[,4]),mean(voluntario05git[,4]))

conjuntoMediasTCBsvn = c(mean(voluntario01svn[,2]),mean(voluntario02svn[,2]),mean(voluntario03svn[,2]),mean(voluntario04svn[,2]),mean(voluntario05svn[,2]))
conjuntoMediasTIBsvn = c(mean(voluntario01svn[,3]),mean(voluntario02svn[,3]),mean(voluntario03svn[,3]),mean(voluntario04svn[,3]),mean(voluntario05svn[,3]))
conjuntoMediasTILsvn = c(mean(voluntario01svn[,4]),mean(voluntario02svn[,4]),mean(voluntario03svn[,4]),mean(voluntario04svn[,4]),mean(voluntario05svn[,4]))


#Para o cenario 0 somente o passo1 importa. O passo1 do experimento eh o passo2 no arquivo.
#TCA
conjuntoTCAgit = c(voluntario01git[1,1],voluntario02git[1,1],voluntario03git[1,1],voluntario04git[1,1],voluntario05git[1,1])
conjuntoTCAsvn = c(voluntario01svn[1,1],voluntario02svn[1,1],voluntario03svn[1,1],voluntario04svn[1,1],voluntario05svn[1,1])


conjuntoTCBgit = c(voluntario01git[,2],voluntario02git[,2],voluntario03git[,2],voluntario04git[,2],voluntario05git[,2])
conjuntoTIBgit = c(voluntario01git[,3],voluntario02git[,3],voluntario03git[,3],voluntario04git[,3],voluntario05git[,3])
conjuntoTILgit = c(voluntario01git[,4],voluntario02git[,4],voluntario03git[,4],voluntario04git[,4],voluntario05git[,4])


conjuntoTCBsvn = c(voluntario01svn[,2],voluntario02svn[,2],voluntario03svn[,2],voluntario04svn[,2],voluntario05svn[,2])
conjuntoTIBsvn = c(voluntario01svn[,3],voluntario02svn[,3],voluntario03svn[,3],voluntario04svn[,3],voluntario05svn[,3])
conjuntoTILsvn = c(voluntario01svn[,4],voluntario02svn[,4],voluntario03svn[,4],voluntario04svn[,4],voluntario05svn[,4])





#conjuntoTCBgit = c(mean(voluntario01_cen_01_11_git[,1]),mean(voluntario02_cen_01_11_git[,1]),mean(voluntario03_cen_01_11_git[,1]),mean(voluntario04_cen_01_11_git[,1]),mean(voluntario05_cen_01_11_git[,1]),mean(voluntario06_cen_01_11_git[,1]),mean(voluntario07_cen_01_11_git[,1]),mean(voluntario08_cen_01_11_git[,1]),mean(voluntario09_cen_01_11_git[,1]),mean(voluntario10_cen_01_11_git[,1]),mean(voluntario11_cen_01_11_git[,1]),mean(voluntario12_cen_01_11_git[,1]),mean(voluntario13_cen_01_11_git[,1]),mean(voluntario14_cen_01_11_git[,1]),mean(voluntario15_cen_01_11_git[,1]),mean(voluntario16_cen_01_11_git[,1]))
#conjuntoTIBgit = c(mean(voluntario01_cen_01_11_git[,2]),mean(voluntario02_cen_01_11_git[,2]),mean(voluntario03_cen_01_11_git[,2]),mean(voluntario04_cen_01_11_git[,2]),mean(voluntario05_cen_01_11_git[,2]),mean(voluntario06_cen_01_11_git[,2]),mean(voluntario07_cen_01_11_git[,2]),mean(voluntario08_cen_01_11_git[,2]),mean(voluntario09_cen_01_11_git[,2]),mean(voluntario10_cen_01_11_git[,2]),mean(voluntario11_cen_01_11_git[,2]),mean(voluntario12_cen_01_11_git[,2]),mean(voluntario13_cen_01_11_git[,2]),mean(voluntario14_cen_01_11_git[,2]),mean(voluntario15_cen_01_11_git[,2]),mean(voluntario16_cen_01_11_git[,2]))
#conjuntoTILgit = c(mean(voluntario01_cen_01_11_git[,3]),mean(voluntario02_cen_01_11_git[,3]),mean(voluntario03_cen_01_11_git[,3]),mean(voluntario04_cen_01_11_git[,3]),mean(voluntario05_cen_01_11_git[,3]),mean(voluntario06_cen_01_11_git[,3]),mean(voluntario07_cen_01_11_git[,3]),mean(voluntario08_cen_01_11_git[,3]),mean(voluntario09_cen_01_11_git[,3]),mean(voluntario10_cen_01_11_git[,3]),mean(voluntario11_cen_01_11_git[,3]),mean(voluntario12_cen_01_11_git[,3]),mean(voluntario13_cen_01_11_git[,3]),mean(voluntario14_cen_01_11_git[,3]),mean(voluntario15_cen_01_11_git[,3]),mean(voluntario16_cen_01_11_git[,3]))
#
#conjuntoTCBsvn = c(mean(voluntario01_cen_01_11_svn[,1]),mean(voluntario02_cen_01_11_svn[,1]),mean(voluntario03_cen_01_11_svn[,1]),mean(voluntario04_cen_01_11_svn[,1]),mean(voluntario05_cen_01_11_svn[,1]),mean(voluntario06_cen_01_11_svn[,1]),mean(voluntario07_cen_01_11_svn[,1]),mean(voluntario08_cen_01_11_svn[,1]),mean(voluntario09_cen_01_11_svn[,1]),mean(voluntario10_cen_01_11_svn[,1]),mean(voluntario11_cen_01_11_svn[,1]),mean(voluntario12_cen_01_11_svn[,1]),mean(voluntario13_cen_01_11_svn[,1]),mean(voluntario14_cen_01_11_svn[,1]),mean(voluntario15_cen_01_11_svn[,1]),mean(voluntario16_cen_01_11_svn[,1]))
#conjuntoTIBsvn = c(mean(voluntario01_cen_01_11_svn[,2]),mean(voluntario02_cen_01_11_svn[,2]),mean(voluntario03_cen_01_11_svn[,2]),mean(voluntario04_cen_01_11_svn[,2]),mean(voluntario05_cen_01_11_svn[,2]),mean(voluntario06_cen_01_11_svn[,2]),mean(voluntario07_cen_01_11_svn[,2]),mean(voluntario08_cen_01_11_svn[,2]),mean(voluntario09_cen_01_11_svn[,2]),mean(voluntario10_cen_01_11_svn[,2]),mean(voluntario11_cen_01_11_svn[,2]),mean(voluntario12_cen_01_11_svn[,2]),mean(voluntario13_cen_01_11_svn[,2]),mean(voluntario14_cen_01_11_svn[,2]),mean(voluntario15_cen_01_11_svn[,2]),mean(voluntario16_cen_01_11_svn[,2]))
#conjuntoTILsvn = c(mean(voluntario01_cen_01_11_svn[,3]),mean(voluntario02_cen_01_11_svn[,3]),mean(voluntario03_cen_01_11_svn[,3]),mean(voluntario04_cen_01_11_svn[,3]),mean(voluntario05_cen_01_11_svn[,3]),mean(voluntario06_cen_01_11_svn[,3]),mean(voluntario07_cen_01_11_svn[,3]),mean(voluntario08_cen_01_11_svn[,3]),mean(voluntario09_cen_01_11_svn[,3]),mean(voluntario10_cen_01_11_svn[,3]),mean(voluntario11_cen_01_11_svn[,3]),mean(voluntario12_cen_01_11_svn[,3]),mean(voluntario13_cen_01_11_svn[,3]),mean(voluntario14_cen_01_11_svn[,3]),mean(voluntario15_cen_01_11_svn[,3]),mean(voluntario16_cen_01_11_svn[,3]))


#conjunto1 <- read.table("git.txt",sep=",")
#conjunto2 <- read.table("svn.txt",sep=",")


##########################################################
## Conjunto Total
##########################################################

#conjuntos <- rbind(conjuntos1,conjuntos2)
#medPop <- mean(conjuntos)




###########################################################
## Calculo do teste de hip�tese com base na m�dia
###########################################################

#Hip1 <- wilcox.test(medAmos,medAmos2,alternative=c("two.sided"),paired=TRUE)
#Rej1 = ifelse (Hip1$p.value<0.05, 1, 0)

#Hip2 <- t.test(medAmos,medAmos2,alternative=c("two.sided"),paired=TRUE)
#Rej2 = ifelse (Hip2$p.value<0.05, 1, 0)


